<template>
  <div>Login</div>
</template>

<script>
export default {
  name: "Login",
  mounted() {
    console.log(this);
  },
  // 路由进入时
  beforeRouteEnter(to, from, next) {
    console.log(to, from, next);
    console.log("路由内进入时守卫");
    console.log(this,"333"); //undefined
    next(() => {
      console.log(this,"444");
    });
  },
  
  // 路由更新时
  beforeRouteUpdate(to, from, next) {
    console.log(to, from, next, "beforeRouteUpdate");
    console.log("组件内更新时");
  },
};
</script>

<style></style>
